<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <meta name="keywords" content="{{ config['KEYWORDS'] }}">
    <meta name="description" content="{{ config['DESCRIPTION'] }}">
    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
    <title>{% block title %}{% endblock %} - {{ config['MAIN_TITLE'] }}</title>
    {% if config['DEBUG'] == True %}
      <link rel=stylesheet type=text/css href="{{ url_for('frontend.static', filename='css/frontend.css') }}">
    {% else %}
      <link rel=stylesheet type=text/css href="{{ config['FRONTEND_MIN_CSS'] }}">
    {% endif %}
  </head>
  <body>
    <div id="container">
      <div id="logo">
        <a href="/" title="{{ self.title() }}"></a>
        <p>{{ profile.signature }}</p>
      </div>
      <div id="nav">
        <ul>
          <li><a href="{{ url_for('frontend.home') }}">Home</a></li>
          <li><a href="{{ url_for('frontend.rss') }}">RSS</a></li>
          {% for p in pages %}
          <li><a href="{{ url_for('frontend.page', page_url=p.url) }}">{{ p.title }}</a></li>
          {% endfor %}
        </ul>
      </div>
      {% block content %}
      {% endblock %}
      <div id="sidebar">
        <h2>SEARCH</h2>
        <form action="http://google.com/search" method="get" accept-charset="utf-8" id="search_form">
          <input class="search" type="text" name="q" results="0" autocomplete="true">
          <input type="hidden" name="q" value="site:{{ config['SITE_URL'] }}">
        </form>
        <br />
        <h2>ARCHIVES</h2>
        <ul id="side-cats">
          {% for c in categories %}
          <li class="cat-item"><a href="{{ url_for('frontend.diary_list', cat_name=c.name) }}" title="{{ c.name }}">{{ c.name }}({{ c.diaries|count }})</a></li>
          {% endfor %}
        </ul>
        <h2>LINKS</h2>
        <ul class="recent-comments">
          <li><a href="http://weibo.com/moxing0821" title="我的微博" target="_blank">我的微博</a></li>
          <li><a href="https://github.com/lxxgreat" title="我的github主页" target="_blank">我的github主页</a></li>
          <li><a href="mailto:lxxgreat@163.com" title="交换链接">交换链接</a>: 交换链接可以给我邮件...</li>
        </ul>
        <h2>OPEN SOURSE</h2>
        <ul class="opensourse">
          <li><a href="https://github.com/ScenK/dev_blog2/" target="_blank" title="博客Github开源代码">Github</a>: 博客Github开源代码</li>
          <li style="display:none"><a href="https://github.com/ScenK/dev_blog_webservice/" target="_blank" title="开放API">Github</a>: 博客开放API</li>
          <li style="display:none"><a href="https://github.com/ScenK/Dev_Blog_Mobile/" target="_blank" title="移动版源码">Github</a>: WebApp博客开源代码</li>
        </ul>
      </div>
    </div>
    <footer>
    &copy; <a href="mailto:he.kang@dev-engine.com">Dev-engine</a>  |  Powered By Tornado and MongoDB
    </footer>
    {% block script %}{% endblock %}
    {% if config['DEBUG'] == True %}
      <script type="text/javascript" src="{{ url_for('frontend.static', filename='js/frontend.js') }}"></script>
    {% else %}
      <script type="text/javascript" src="{{ config['FRONTEND_MIN_JS'] }}"></script>
      {{ config['ANALYTICS']|safe }}
    {% endif %}
  </body>
</html>
